package be.ipl.streams.dao;

import java.util.List;

public interface Dao<E> {
	
	/**
	 * Persist the entity in the database
	 * @param entity
	 * @return
	 */
	E register(E entity);
	
	/**
	 * Update the database based on the given entity
	 * @param entity
	 * @return
	 */
	E update(E entity);
	
	/**
	 * 
	 * @param id
	 * @return
	 */
	E refresh(int id);
	
	/**
	 * Obtain the entity corresponding to the id
	 * @param id
	 * @return
	 */
	E research(int id);
	
	/**
	 * List every element of this entity
	 * @return
	 */
	List<E> list();
	
}
